<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
    <title></title>
	<include file="public/reference"/>
    <script type="text/javascript">
        var alert = function (content)
        {
            $.ligerDialog.alert(content);
        };
        $(function ()
        {
        	var isAdd=(window.location.hash==='#add');
        	var editType=isAdd?'添加':'更新'
            //搜索表单
			var form1=$('#form1').ligerForm({
                inputWidth: 140, labelWidth:60, space: 20,align:'left',labelAlign: 'left',
                 fields: [
	                { display: "登录名", name: "username", newline: false, type: "text"}, 
	                
	                { display: "邮箱", name: "email", newline: false, type: "text"},
	                
	                { display: "密码", name: "email", newline: false, type: "password"},
	                
	                { display: "姓名", name: "name", newline: false, type: "text"},
	                
	                { display: "学校", name: "school_id",comboboxName:'school_id', newline: false, type: "select", options: {
	                		data:{$schoolList},valueField : 'id',textField: 'name' } },
	                
	                { display: "状态", name: "state",comboboxName:'state', newline: false, type: "select", options: {
	                		data:userStateList,valueField : 'id',textField: 'name' } },
                ]
			});
			$('#form1>.l-form-container>ul').append("<input type='button' id='submitBtn' class='l-fieldcontainer' value='搜索'/>");
            //提交
            $("#submitBtn").ligerButton({ click: function (){
           	 		var loading=$("#pageloading").show();
            		$.post('__URL__/edit',form1.getData())
            		.fail(function (data) {
            			loading.hide();
						$.ligerDialog.alert(editType+"失败!");       			
            		}).done(function (data) {
            			loading.hide();
            			$.ligerDialog.alert()
            		});
            	}
        	}); 
            $("#pageloading").hide();
        });

    </script>
</head>
<body style="padding:0px; overflow:hidden;"> 
<div class="l-loading" style="display:block" id="pageloading"></div> 
<div id="form1"></div>
</body>
</html>
